- i = 0
- ii = 0
- num = -1
- frequencies = BundleVariation.frequency
#work_area
  - f.fields_for :bundle_variations do |ff|
    - v = frequencies[i]
    - if frequencies.include? ff.object.frequency
      - frequencies = frequencies.delete_if{|x| x.include? ff.object.frequency}
      - v = ff.object.frequency
      = hidden_field_tag "bundle[bundle_variations_attributes][#{ii}][_delete]", nil, {:del_rec => "1"}
      - num = ii
      - ii +=1
      / - i = i-1 if i>0
    - else
      - i +=1
      - num = -1
    / = i.to_s + " i"
    - if v
      %p
        = ff.label v
        %br
      - if num > -1
        = ff.check_box :frequency, {:spec_num => "#{num}"}, v, ""
      - else
        = ff.check_box :frequency, {}, v, ""
      %p
        = ff.label :price
        %br
        = ff.text_field :price
      %p
      = render :partial => 'trial_periods/form', :locals => {:ff => ff}